
//添加
function subMsg(){
    var type = $('#type').val();
    var versionCode = $('#versionCode').val();
    var punishMoney = $('#punishMoney').val();
	$("#top_notice").css("display", "block")
    $.ajax({
        url:  urlcore + "/api/punishSetting/addOrUpdatePunishSetting",
        type: "post",
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify({
        	"userType": userType,
            "punishType": punishType,
            "punishMoney": punishMoney,
            "punishDays":punishDays,
            "punishName":punishName,
            "status":0
        }),
        dataType: "json",
        success:function(data){
            if (data.success == true) {
                    if (confirm("添加成功，是否继续添加？")) {
                        //刷新
                        location.reload();
                    } else {
                        //跳转列表页
                        window.location.href = "punishsetting_list.html";
                    }
            } else if (data.code == 'OVERTIME') {
                var thisUrl = window.location.href;
                if (thisUrl.indexOf('login.html') <= -1) {
                    top.window.location.href = "login.html";
                }
            } else {
                alert(data.msg);
            }

        },
        error: function() {
            alert("error");
        }

    });
}

